package com.njtoyo.taxi.admin.rest.controller.data;

import com.njtoyo.taxi.admin.rest.wrapper.data.data_analysis.DriverDataWrapper;
import com.njtoyo.taxi.admin.service.data.DriverKpiService;
import com.njtoyo.taxi.entity.backend.AdminUser;
import com.taxi.entity.common.RestResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * 司机考核
 */
@RequestMapping("/data/driver-kpi")
@RestController
public class DriverKpiController {

    @Autowired
    private DriverKpiService driverKpiService;




    @GetMapping("/list")
    public RestResult driverData(@ModelAttribute("admin") AdminUser adminUser, DriverDataWrapper wrapper) {
        return driverKpiService.list(adminUser, wrapper);
    }


    @GetMapping("/driver/export")
    public void driverDataExport(@ModelAttribute("admin") AdminUser adminUser, DriverDataWrapper wrapper, HttpServletResponse response) {
        driverKpiService.driverDataExport(adminUser, wrapper, response);
    }
}
